import 'package:flutter_test/flutter_test.dart';
import 'package:music_center/music_center.dart';
import 'package:music_center/music_center_platform_interface.dart';
import 'package:music_center/music_center_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMusicCenterPlatform
    with MockPlatformInterfaceMixin
    implements MusicCenterPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<void> stopMusic() {
    // TODO: implement stopMusic
    throw UnimplementedError();
  }
}

void main() {
  final MusicCenterPlatform initialPlatform = MusicCenterPlatform.instance;

  test('$MethodChannelMusicCenter is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMusicCenter>());
  });

  test('getPlatformVersion', () async {
    MusicCenter musicCenterPlugin = MusicCenter();
    MockMusicCenterPlatform fakePlatform = MockMusicCenterPlatform();
    MusicCenterPlatform.instance = fakePlatform;

    expect(await musicCenterPlugin.getPlatformVersion(), '42');
  });
}
